package com.lin.bank.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * 转账记录
 *
 * @author Li
 * @date 2022/04/21
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("transaction_record")
public class TransactionRecord {

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    private String cardNo;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", locale = "zh",timezone ="GMT+8")
    private Date transactionDate;

    private Double amount;

    private Double balance;

    private String transactionType;

    private String remark;

    public TransactionRecord(String cardNo, Date transactionDate, Double amount, Double balance, String transactionType, String remark) {
        this.cardNo = cardNo;
        this.transactionDate = transactionDate;
        this.amount = amount;
        this.balance = balance;
        this.transactionType = transactionType;
        this.remark = remark;
    }
}
